'use strict';

/**
 * @param {Egg.Application} app - egg application
 */
module.exports = app => {
  const { router, controller, middleware, io } = app;
  router.get('/', controller.home.index);
  router.get('/user', middleware.jwt(app.config.jwt), controller.user.get);
  router.get('/user/findById/:id', controller.user.getUserById);
  router.post('/user', controller.user.post);
  router.post('/login', controller.user.login);

  // io
  // io.of('/').route('server', io.controller.home.server);
  io.of('/').route('exchange', io.controller.nsp.exchange);
};
